# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.TPU.V2.Model.QueuedResource do
  @moduledoc """
  A QueuedResource represents a request for resources that will be placed in a queue and fulfilled when the necessary resources are available.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time when the QueuedResource was created.
  *   `guaranteed` (*type:* `GoogleApi.TPU.V2.Model.Guaranteed.t`, *default:* `nil`) - Optional. The Guaranteed tier
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Immutable. The name of the QueuedResource.
  *   `queueingPolicy` (*type:* `GoogleApi.TPU.V2.Model.QueueingPolicy.t`, *default:* `nil`) - Optional. The queueing policy of the QueuedRequest.
  *   `reservationName` (*type:* `String.t`, *default:* `nil`) - Optional. Name of the reservation in which the resource should be provisioned. Format: projects/{project}/locations/{zone}/reservations/{reservation}
  *   `spot` (*type:* `GoogleApi.TPU.V2.Model.Spot.t`, *default:* `nil`) - Optional. The Spot tier.
  *   `state` (*type:* `GoogleApi.TPU.V2.Model.QueuedResourceState.t`, *default:* `nil`) - Output only. State of the QueuedResource request.
  *   `tpu` (*type:* `GoogleApi.TPU.V2.Model.Tpu.t`, *default:* `nil`) - Optional. Defines a TPU resource.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :guaranteed => GoogleApi.TPU.V2.Model.Guaranteed.t() | nil,
          :name => String.t() | nil,
          :queueingPolicy => GoogleApi.TPU.V2.Model.QueueingPolicy.t() | nil,
          :reservationName => String.t() | nil,
          :spot => GoogleApi.TPU.V2.Model.Spot.t() | nil,
          :state => GoogleApi.TPU.V2.Model.QueuedResourceState.t() | nil,
          :tpu => GoogleApi.TPU.V2.Model.Tpu.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:guaranteed, as: GoogleApi.TPU.V2.Model.Guaranteed)
  field(:name)
  field(:queueingPolicy, as: GoogleApi.TPU.V2.Model.QueueingPolicy)
  field(:reservationName)
  field(:spot, as: GoogleApi.TPU.V2.Model.Spot)
  field(:state, as: GoogleApi.TPU.V2.Model.QueuedResourceState)
  field(:tpu, as: GoogleApi.TPU.V2.Model.Tpu)
end

defimpl Poison.Decoder, for: GoogleApi.TPU.V2.Model.QueuedResource do
  def decode(value, options) do
    GoogleApi.TPU.V2.Model.QueuedResource.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TPU.V2.Model.QueuedResource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
